package com.fh.shop.api.token.biz;

import com.fh.shop.api.common.ServerResponse;
import com.fh.shop.api.common.SystemConst;
import com.fh.shop.api.util.KeyUtil;
import com.fh.shop.api.util.RedisUtil;
import org.springframework.stereotype.Service;

import java.util.UUID;

@Service("tokenService")
public class ITokenServiceImpl implements ITokenService {


    @Override
    public ServerResponse crateToken() {
        String key = UUID.randomUUID().toString();
        RedisUtil.setEx(KeyUtil.buildTokenKey(key),"", SystemConst.Token_UUID_EXPIRE_TIME);
        return ServerResponse.success(key);
    }
}
